//Daniel Kendix
//November 29, 2011

//Point class

public class Point {
	public double x;
	public double y;
	public double z;

	public Point(double X, double Y, double Z) {
		x = X;
		y = Y;
		z = Z;
	}

	public static double mag(Point p) {
		return Math.sqrt(p.x * p.x + p.y * p.y + p.z * p.z);
	}

	public static double mag(Point p, Point q) {
		return Math.sqrt(Math.pow(p.x - q.x, 2) + Math.pow(p.y - q.y, 2)
				+ Math.pow(p.z - q.z, 2));
	}

	public static Point add(Point p, Point q) {
		return new Point(p.x + q.x, p.y + q.y, p.z + q.z);
	}

	public boolean equals(Point p) {
		if (p.x == x && p.y == y && p.z == z)
			return true;
		else
			return false;
	}

}
